Ccay.Module.define("Ccay.example.ui.popup", function(page, $S) {
	var columns1 = [ {
		//id :"name",  //搜索条件生成INPUT的name属性值与后台VO属性对应
		//isCondition : true, //是否作为搜索条件
		header : $i18n("ccay.common.label.name"),
		field : 'name'
	}, {
		header : "sAge",
		field : 'age',
		type: 'integer'
	}, {
		//id :"sex", //搜索条件生成INPUT的name属性值与后台VO属性对应
		//isCondition, : true//是否作为搜索条件
		header : "sSex",
		field : 'sex',
		type: 'bool',
		format : {
			isIcon: true
		},
	} ];
	var conf1 = {
		suggestOp : {
			url : "services/ccay/demo/student/list/page/80/1",
			fieldMapper : {
				name : $i18n("ccay.common.label.name"),
				age : "年龄"
			}
		},
		popOp : {
			igrid : true,
			servicePath : "services/ccay/demo/student/list",
			historySupport : false,
			reSizable : true,
			uniqueKey : "id",
			columns : columns1,
			//条件搜索区域渲染
			condRender : function() {
				 
				return '<ul>'+
						    '<li class="ccay-form-row">'+
						        '<samp class="i18n" i18nKey="ccay.common.label.name" ></samp>'+
						        '<span class="ccay-form-input"><input type="text" name="name" maxlength="20"/></span>'+	
						    '</li>'+
						    '<li class="ccay-form-row">'+
						        '<samp class="i18n" i18nKey="Sex"></samp>'+
						        '<span class="ccay-form-input"><input type="text" class="init ccay-combobox" name="sex" service="ENUM:SexEnum" id="sex1"/></span>'+
						    '</li>'+
					    '</ul>';
			},
			initRender : function(conditionDivSelector, popupObj, $S){
				conditionDivSelector.height("60px");
			},
			title :"标题"
		},
		displayField : "name",
		valueField : "id"
	};
	var columns2 = [  {
		id :"name",  //搜索条件生成INPUT的name属性值与后台VO属性对应
		isCondition : true, //是否作为搜索条件
		header : $i18n("ccay.common.label.name"),
		field : 'name'
	}, {
		header : "sAge",
		field : 'age',
		type: 'integer'
	}, {
		header : "sSex",
		field : 'sex',
		type: 'bool',
		format : {
			isIcon: true
		},
	} ];
	var conf2 = {
			suggestOp : {
				url : "services/ccay/demo/student/list/page/80/1",
				fieldMapper : {
					name : $i18n("ccay.common.label.name"),
					age : "年龄"
				}
			},
			popOp : {
				servicePath : "services/ccay/demo/student/list",
				uniqueKey : "id",
				columns : columns2,
				title : $i18n("ccay.registry.label.popupTitle")
			},
			multi:true,
			displayField : "name",
			valueField : "id"
		};
	$("#suggest2").ccayPopBox(conf2);
	$("#suggest1").ccayPopBox(conf1);
	page.ready=function(){
		$("#popupDemo").ccayTab();	
	}
});
